<?php
require_once("../../views/layout/cabecalho.php");
require_once("../../controllers/FuncionarioController.class.php");
$funcionario = $funcionarioController->listAll();
?>


<h2>Lista de Funcionário</h2>

<div class="actions">
    <ul>
        <li><a href="../../views/funcionario/add.php">Novo Funcionário</a></li>
        <li></li>
    </ul>

</div>

<table cellpadding="0" cellspacing="0" border="0" class="display" id="pesquisar_tabelas">
    <thead>
        <tr>
            <th>Id</th>
            <th>Nome</th>
            <th>CPF</th>
            <th>RG</th> 
            <th>Cargo</th>
            <th>Ações</th>
        </tr>
    </thead>
    <tbody>

        <?php for ($i = 1; $i < count($funcionario); $i++) { ?>
            <tr>
                <td><?php echo $funcionario[$i]->getId(); ?></td>
                <td><a href="../../views/funcionario/view.php?id=<?php echo $funcionario[$i]->getId(); ?>"><?php echo $funcionario[$i]->getNome(); ?></a></td>
                <td><?php echo $funcionario[$i]->getCpf(); ?></td>
                <td><?php echo $funcionario[$i]->getRg(); ?></td>
                <td><?php echo $funcionario[$i]->getCargo();?></td>

                <td><a href="../../views/funcionario/edit.php?id=<?php echo $funcionario[$i]->getId(); ?>">Editar</a>
                    <a href="../../controllers/FuncionarioController.class.php?metodo=delete&id=<?php echo $funcionario[$i]->getId(); ?>">Excluir</a>
                </td>
            </tr>
        <?php } ?>

    </tbody>

    <tfoot>
        <tr>
            <th>Id</th>
            <th>Nome</th>
            <th>CPF</th>
            <th>RG</th> 
            <th>Cargo</th>
            <th>Ações</th>
        </tr>
    </tfoot>

</table>


<?php
require_once("../../views/layout/rodape.php");
?>